In mobile communications systems, when wireless communications are performed between a base station and a terminal (a mobile station) or between a terminal and another terminal, there is a need to synchronize a wireless frame timing between a transmitting side and a receiving side. For this purpose, if there occurs a deviation in the wireless frame timing, the terminal corrects the wireless frame timing for communications between the base station and the terminal and the receiving side corrects the wireless frame timing for communications between the terminals.
In audio communications, a transmitting side encodes audio data by an audio codec, modulates the encoded audio data, and transmits the modulated audio data by carrying them on a wireless frame. A receiving side decodes a received and demodulated wireless frame by an audio codec to extract the audio data. That is, there is a need to adjust a sampling timing in A/D or D/A conversion of the audio data in the audio codec to a wireless frame timing.
(Wireless Frame and Audio Frame)
Next, configurations of a wireless frame and an audio frame are described. The wireless frame includes 384 symbols, and one wireless frame is provided when a symbol timing counter counts 384 symbols. Then, the symbol timing counter is reset to “0” and then counts symbol timings of the next wireless frame. The wireless frame length is 40 ms, the wireless frame timing is 25 Hz, the symbol length is 104.17 μs, and the symbol timing is 9.6 kHz.
The audio frame in the audio codec includes 320 audio samples, and one audio frame is provided when an audio sampling counter counts 320 audio samples. Then, the audio sampling counter is reset to “0” and then counts a sample timing of the next audio frame. The audio frame length is 40 ms, the audio frame timing is 25 Hz, as in the wireless frame, the audio sample length (audio sampling interval) is 125 μs, and the audio sampling timing is 8 kHz. The audio codec operates by using an audio codec reference clock (256 kHz) to count 32 times within one audio sampling interval. The reference clock is supplied from a controller.
Here, since the audio frame timing needs to be adjusted to the wireless frame timing, a timing at which the audio sampling counter counts 320 audio samples and then is reset to “0” is adjusted to a timing at which the symbol timing counter counts 384 symbols and then is reset to “0.”
In addition, a clock (19.2 MHz) is provided in the wireless device as the general reference clock of the entire device. Counters and clocks for various parts are generated by dividing the reference clock. The symbol timing corresponds to 2000 counts of 19.2 MHz and the audio sampling timing corresponds to 2400 counts of 19.2 MHz.
(Conventional Audio Frame Timing Correction Method: FIG. 5)
Next, a conventional audio frame timing correction method will be described with reference to FIG. 5. FIG. 5 is a view for explaining a conventional audio frame timing correction method. (a) of FIG. 5 shows a wireless frame having a deviated timing, (b) of FIG. 5 shows an audio frame before correction, and (c) of FIG. 5 shows an audio frame after correction. In particular, (a) of FIG. 5 shows a case where a wireless frame timing of a wire device leads a timing of a counterpart performing wireless communications by 2.5 μs every 12 symbol timings. In this case, the wireless frame is required to be shortened by 2.5 μs every 12 symbol timings.
To this end, the symbol length is shortened by 2.5 μs every 12 symbol timings (count 11, count 23, count 35, . . . ). Specifically, a symbol clock is outputted earlier by 2.5 μs every 12 symbol timings. That is, 2.5 μs/(1/19.2 MHz)=48 clocks and correction is made to absorb the deviation by incrementing the symbol counter to count the next symbol timing at a timing earlier by 48 clocks of 19.2 MHz every 12 symbols.
Accordingly, while the symbol counter counts 384 symbols, time is saved by 80 μs (=2.5 μs×(384/12)) and one wireless frame length becomes 39.92 ms (=40 ms−80 μs).
In addition, as shown in (b) of FIG. 5, when the symbol timing counter of the wireless frame counts 384 symbols and then is reset to “0,” after the audio sampling counter of the audio frame counts 319 audio samples, an interval for 320th count elapses just 45 μs and the audio frame length does not reach 40 ms. If the audio sampling timing is counted based on the audio codec reference clock as it stands, 80 μs has to elapse more to start the next audio frame.
As described above, since the audio frame timing needs to be synchronized with the wireless frame timing, at the 320-th audio sampling timing, the audio sampling counter is reset to “0” and begins to count the next audio frame at the point of time when 45 μs elapses, as shown in (c) of FIG. 5. That is, the remaining data corresponding to 80 μs at the 320-th audio sampling timing are lost.
When an interface with the audio codec operates at clocks of, e.g., 256 kHz, 21 clocks (=80 μs/(1/256 kHz)=20.48) are lost.
Some audio codec devices may not operate normally or may destroy data in the unit of audio frame even when one reference clock is lost. Such an audio codec device has a problem of abnormal audio or audio disconnection. In addition, if there are data in synchronization with the reference clock, the data may be lost in time for the reference clock, which may result in audio disconnection.
To avoid the data loss, it may be considered that audio-encoded/decoded data are first buffered and are outputted without making adjustment of the reference clock. However, this may result in increase of a circuit scale, delay of audio data and difficulty in timing adjustment.
(Related Technique)
As one of techniques for correcting an audio data timing in wireless communications, there has been proposed a “wireless base station” disclosed in Japanese Publication Application No. 2010-252019 (JP2010-252019A) (by Hitachi Kokusai Electronic Inc.). JP2010-252019A discloses technique of allocating an uplink frame of audio data by a converter, detecting temporal change in the audio data by comparing time information of the audio data with time information of an audio control signal from a network by a correction processor, and correcting the allocation timing of the uplink frame of the audio data in the converter based on the temporal change.
However, the conventional audio frame timing correction method and wireless device have problems in that audio data are lost due to shortening of a wireless frame resulting from a deviation of the wireless frame timing from that of a counterpart, which may result in abnormal audio and audio disconnection.
In addition, the conventional audio frame timing correction method and wireless device have another problem of increase in a circuit scale and complicated control of timing adjustment in an audio-encoded/decoded data buffering configuration.